NSPredicate aggregate function [SIZE] gives 'unsupported function expression' error

Posted by jinglesthula on Stack Overflow See other posts from Stack Overflow or by jinglesthula
Published on 2011-06-24T23:48:48Z Indexed on 2011/06/25 0:22 UTC
Read the original article Hit count: 164

iOS 4: I have entities in Core Data (using SQLite, which is a requirement) of:

  • Request
  • Response (which has a property personId)
  • Revision

Relationships are:

  • Request <-->> Revision
  • Request <-->> Response
  • Revision <--> Response

(e.g. each request may have many responses; each request/response pair may have many revisions)

I'm trying to do a predicate to get all Responses with a given personId that have zero Revisions.

Using:

(personId == %d) && (Request.Revision[SIZE] == 0)

in my predicate string gives me a runtime exception "Unsupported function expression Request.Revision[SIZE]"

The documentation seems pretty sparse on aggregate functions, only noting that they exist, but with no syntax or examples. Not sure if it's my syntax or if the SIZE function really isn't supported in iOS.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c